<HTML> 
<HEAD> 
	<TITLE>3rd Party ROBOTC Drivers</TITLE> 
<link href="tabs.css" rel="stylesheet" type="text/css"/> 
<link href="doxygen.css" rel="stylesheet" type="text/css"/> 
</HEAD> 
 
<BODY bgcolor="#ffffff" link="#000000" vlink="#000000"> 
<table width="100%" bgcolor="navy" cellspacing=0 cellpadding=1 border=0> 
<tr><td><table width="100%" bgcolor="#EEEEDD" cellspacing=0 cellpadding=3 border=0> 
<tr> 
    <td width="33%" align="left"> <img src="images/LOGO_NXT.gif" width=266 height=44 border="0" alt="Mindstorms"></td> 
    <td><b><font size="+3" color="navy">3rd Party ROBOTC Drivers</font></b></td> 
    <td align="right"> <img src="images/logo.png" width=44 height=44 border="0" alt="RobotC"></td>     
</tr> 
  <tr bgcolor="#cccc99" align="right"> 
          <td colspan=3> <font face="arial" size="-1"> [<a href=main.html>Home</a>] [<a target=_top href="https://sourceforge.net/projects/rdpartyrobotcdr/">Download</a>] [<a target=_top href="http://apps.sourceforge.net/mantisbt/rdpartyrobotcdr/my_view_page.php">Submit a bug/suggestion</a>]  [<a target=_top href="http://www.robotc.net/forums/">ROBOTC Forums</a>] [<a target=_top href="http://botbench.com">Blog</a>] [<a target=_top href="http://sourceforge.net/donate/index.php?group_id=257238">Support this project</a>]</font> </td> 
</tr> 
</table></td></tr> 
</table> 
<!-- Generated by Doxygen 1.7.2 -->
<div class="header">
  <div class="summary">
<a href="#files">Files</a> &#124;
<a href="#define-members">Defines</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<h1>Main common include<br/>
<small>
[<a class="el" href="group__common__includes.html">Common functions</a>]</small>
</h1>  </div>
</div>
<div class="contents">
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="files"></a>
Files</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="common_8h.html">common.h</a></td></tr>

<p><tr><td class="mdescLeft">&#160;</td><td class="mdescRight"><p>Commonly used functions used by drivers. </p>
<br/></td></tr>
</p>
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__common.html#ga516e1f8e9479cb339afb3cb1cffdc536">__COMMON_H_SENSOR_CHECK__</a>&#160;&#160;&#160;1</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__common.html#gaf80235eb257dc97cb46655fde261602e">MAX_ARR_SIZE</a>&#160;&#160;&#160;17</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__common.html#gaaff7fb3e43cf77514fd0fec17012e360">min2</a>(a, b)&#160;&#160;&#160;(a &lt; b ? a : b)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__common.html#gab1e1ffb6aa15887fa3bda4cfdef1f53a">min3</a>(a, b, c)&#160;&#160;&#160;(a &lt; b) ? ((a &lt; c) ? a : c) : ((b &lt; c) ? b : c)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__common.html#ga59934691af1d56f6e8f6d46c781bbcb5">max2</a>(a, b)&#160;&#160;&#160;(a &gt; b ? a : b)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__common.html#gaa0d45e1e67c5cacf5c9251fcd90a971b">max3</a>(a, b, c)&#160;&#160;&#160;(a &gt; b) ? ((a &gt; c) ? a : c) : ((b &gt; c) ? b : c)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__common.html#ga4090c86dbda268a45068c4413fba327d">clip</a>(a, b, c)&#160;&#160;&#160;min2(c, max2(b, a))</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__common.html#gab9598be7202472dcf4870641fb2cff17">STRTOK_MAX_TOKEN_SIZE</a>&#160;&#160;&#160;20</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__common.html#ga88adde798b06bf51b3ce9c7ac49188b1">STRTOK_MAX_BUFFER_SIZE</a>&#160;&#160;&#160;50</td></tr>
<tr><td colspan="2"><h2><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef ubyte&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a> [MAX_ARR_SIZE]</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef sbyte&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__common.html#gab1288856582274ecffe7a7a3c8b2e7d9">tsByteArray</a> [MAX_ARR_SIZE]</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef ubyte&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__common.html#gaf1da7edf6615d1b2376642de9bbfe449">tMassiveArray</a> [128]</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef ubyte&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__common.html#gacc2928041c5ff8e7f2ddef1e88431e80">tHugeByteArray</a> [64]</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef ubyte&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__common.html#ga54b6c60d5d8ec411391ca920bf8dc97b">tBigByteArray</a> [32]</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef ubyte&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__common.html#ga1c5690729eb47d01453399497a2b3029">tIPaddr</a> [4]</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__common.html#ga79eb917b5a56f0d0e7cf94886c6ac25c">tIntArray</a> [MAX_ARR_SIZE]</td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__common.html#gae58f52c19f82a79aedfdf5b9b3594abd">clearI2CError</a> (tSensors link, ubyte address)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__common.html#ga1079ea93c9d0a5b793ea18ea2144ae7b">clearI2Cbus</a> (tSensors link)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__common.html#ga4fa55ac307e9bb34f74514371f527119">waitForI2CBus</a> (tSensors link)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__common.html#gad02e06f83b264ee6fc7df41eb4712080">writeI2C</a> (tSensors link, <a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a> &amp;request, <a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a> &amp;reply, int replylen)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__common.html#ga98b9f725d95cc626af27f4660a8cddbe">writeI2C</a> (tSensors link, <a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a> &amp;request)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__common.html#gaa2aa3061fe3c887f10977ce6feed3031">getUID</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__common.html#ga978c9ed56c6fce3d8d46f2cdca59b07e">strtok</a> (char *buffer, char *token, char *seperator)</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Commonly used functions used by drivers </p>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="ga516e1f8e9479cb339afb3cb1cffdc536"></a><!-- doxytag: member="common.h::__COMMON_H_SENSOR_CHECK__" ref="ga516e1f8e9479cb339afb3cb1cffdc536" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define __COMMON_H_SENSOR_CHECK__&#160;&#160;&#160;1</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>&lt; define this as 0 to remove the check </p>

<p>Definition at line <a class="el" href="common_8h_source.html#l00070">70</a> of file <a class="el" href="common_8h_source.html">common.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga4090c86dbda268a45068c4413fba327d"></a><!-- doxytag: member="common.h::clip" ref="ga4090c86dbda268a45068c4413fba327d" args="(a, b, c)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define clip</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">a, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">b, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">c&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;min2(c, max2(b, a))</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns x if it is between min and max. If outside the range, it returns min or max. </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="hitechnic-pir-test1_8c-example.html#a1">hitechnic-pir-test1.c</a>, and <a class="el" href="mindsensors-lineleader-test3_8c-example.html#a4">mindsensors-lineleader-test3.c</a>.</dd>
</dl>
<p>Definition at line <a class="el" href="common_8h_source.html#l00118">118</a> of file <a class="el" href="common_8h_source.html">common.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga59934691af1d56f6e8f6d46c781bbcb5"></a><!-- doxytag: member="common.h::max2" ref="ga59934691af1d56f6e8f6d46c781bbcb5" args="(a, b)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define max2</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">a, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">b&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;(a &gt; b ? a : b)</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This function returns the bigger of the two numbers </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="mindsensors-accelerometer-test2_8c-example.html#a3">mindsensors-accelerometer-test2.c</a>.</dd>
</dl>
<p>Definition at line <a class="el" href="common_8h_source.html#l00105">105</a> of file <a class="el" href="common_8h_source.html">common.h</a>.</p>

</div>
</div>
<a class="anchor" id="gaa0d45e1e67c5cacf5c9251fcd90a971b"></a><!-- doxytag: member="common.h::max3" ref="gaa0d45e1e67c5cacf5c9251fcd90a971b" args="(a, b, c)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define max3</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">a, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">b, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">c&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;(a &gt; b) ? ((a &gt; c) ? a : c) : ((b &gt; c) ? b : c)</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This function returns the biggest of the three numbers </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="mindsensors-ps2ctrl-v4-test1_8c-example.html#a0">mindsensors-ps2ctrl-v4-test1.c</a>.</dd>
</dl>
<p>Definition at line <a class="el" href="common_8h_source.html#l00111">111</a> of file <a class="el" href="common_8h_source.html">common.h</a>.</p>

</div>
</div>
<a class="anchor" id="gaf80235eb257dc97cb46655fde261602e"></a><!-- doxytag: member="common.h::MAX_ARR_SIZE" ref="gaf80235eb257dc97cb46655fde261602e" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MAX_ARR_SIZE&#160;&#160;&#160;17</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Maximum buffer size for byte_array, can be overridden in your own program. It's 17 bytes big because the max I2C buffer size is 16, plus 1 byte to denote packet length. </p>

<p>Definition at line <a class="el" href="common_8h_source.html#l00086">86</a> of file <a class="el" href="common_8h_source.html">common.h</a>.</p>

</div>
</div>
<a class="anchor" id="gaaff7fb3e43cf77514fd0fec17012e360"></a><!-- doxytag: member="common.h::min2" ref="gaaff7fb3e43cf77514fd0fec17012e360" args="(a, b)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define min2</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">a, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">b&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;(a &lt; b ? a : b)</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This define returns the smaller of the two numbers </p>

<p>Definition at line <a class="el" href="common_8h_source.html#l00093">93</a> of file <a class="el" href="common_8h_source.html">common.h</a>.</p>

</div>
</div>
<a class="anchor" id="gab1e1ffb6aa15887fa3bda4cfdef1f53a"></a><!-- doxytag: member="common.h::min3" ref="gab1e1ffb6aa15887fa3bda4cfdef1f53a" args="(a, b, c)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define min3</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">a, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">b, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">c&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;(a &lt; b) ? ((a &lt; c) ? a : c) : ((b &lt; c) ? b : c)</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This define returns the smallest of the three numbers </p>

<p>Definition at line <a class="el" href="common_8h_source.html#l00099">99</a> of file <a class="el" href="common_8h_source.html">common.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga88adde798b06bf51b3ce9c7ac49188b1"></a><!-- doxytag: member="common.h::STRTOK_MAX_BUFFER_SIZE" ref="ga88adde798b06bf51b3ce9c7ac49188b1" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define STRTOK_MAX_BUFFER_SIZE&#160;&#160;&#160;50</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="common_8h_source.html#l00407">407</a> of file <a class="el" href="common_8h_source.html">common.h</a>.</p>

</div>
</div>
<a class="anchor" id="gab9598be7202472dcf4870641fb2cff17"></a><!-- doxytag: member="common.h::STRTOK_MAX_TOKEN_SIZE" ref="gab9598be7202472dcf4870641fb2cff17" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define STRTOK_MAX_TOKEN_SIZE&#160;&#160;&#160;20</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="common_8h_source.html#l00406">406</a> of file <a class="el" href="common_8h_source.html">common.h</a>.</p>

</div>
</div>
<hr/><h2>Typedef Documentation</h2>
<a class="anchor" id="ga54b6c60d5d8ec411391ca920bf8dc97b"></a><!-- doxytag: member="common.h::tBigByteArray" ref="ga54b6c60d5d8ec411391ca920bf8dc97b" args="[32]" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef ubyte <a class="el" href="group__common.html#ga54b6c60d5d8ec411391ca920bf8dc97b">tBigByteArray</a>[32]</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>32 byte array for large blobs of data </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="benedettelli-nxt2wifi-test3_8c-example.html#a0">benedettelli-nxt2wifi-test3.c</a>, and <a class="el" href="humarobotics-wifiblock-test1_8c-example.html#a0">humarobotics-wifiblock-test1.c</a>.</dd>
</dl>
<p>Definition at line <a class="el" href="common_8h_source.html#l00129">129</a> of file <a class="el" href="common_8h_source.html">common.h</a>.</p>

</div>
</div>
<a class="anchor" id="gaa172ef131853460e5b9f5c6db81d30f4"></a><!-- doxytag: member="common.h::tByteArray" ref="gaa172ef131853460e5b9f5c6db81d30f4" args="[MAX_ARR_SIZE]" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef ubyte <a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a>[MAX_ARR_SIZE]</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Array of bytes as a struct, this is a work around for RobotC's inability to pass an array to a function. </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="benedettelli-nxt2wifi-test1_8c-example.html#a3">benedettelli-nxt2wifi-test1.c</a>, <a class="el" href="eeprom-test1_8c-example.html#a0">eeprom-test1.c</a>, <a class="el" href="eeprom-test2_8c-example.html#a0">eeprom-test2.c</a>, <a class="el" href="mindsensors-ligthsensorarray-test1_8c-example.html#a0">mindsensors-ligthsensorarray-test1.c</a>, <a class="el" href="mindsensors-lineleader-test2_8c-example.html#a0">mindsensors-lineleader-test2.c</a>, and <a class="el" href="mindsensors-lineleader-test3_8c-example.html#a0">mindsensors-lineleader-test3.c</a>.</dd>
</dl>
<p>Definition at line <a class="el" href="common_8h_source.html#l00125">125</a> of file <a class="el" href="common_8h_source.html">common.h</a>.</p>

</div>
</div>
<a class="anchor" id="gacc2928041c5ff8e7f2ddef1e88431e80"></a><!-- doxytag: member="common.h::tHugeByteArray" ref="gacc2928041c5ff8e7f2ddef1e88431e80" args="[64]" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef ubyte <a class="el" href="group__common.html#gacc2928041c5ff8e7f2ddef1e88431e80">tHugeByteArray</a>[64]</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>64 byte array for very large blobs of data </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="benedettelli-nxt2wifi-test1_8c-example.html#a0">benedettelli-nxt2wifi-test1.c</a>, <a class="el" href="benedettelli-nxt2wifi-test2_8c-example.html#a0">benedettelli-nxt2wifi-test2.c</a>, <a class="el" href="benedettelli-nxt2wifi-test3_8c-example.html#a19">benedettelli-nxt2wifi-test3.c</a>, and <a class="el" href="benedettelli-nxt2wifi-test4_8c-example.html#a0">benedettelli-nxt2wifi-test4.c</a>.</dd>
</dl>
<p>Definition at line <a class="el" href="common_8h_source.html#l00128">128</a> of file <a class="el" href="common_8h_source.html">common.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga79eb917b5a56f0d0e7cf94886c6ac25c"></a><!-- doxytag: member="common.h::tIntArray" ref="ga79eb917b5a56f0d0e7cf94886c6ac25c" args="[MAX_ARR_SIZE]" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef int <a class="el" href="group__common.html#ga79eb917b5a56f0d0e7cf94886c6ac25c">tIntArray</a>[MAX_ARR_SIZE]</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Array of ints as a struct, this is a work around for RobotC's inability to pass an array to a function. </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="mindsensors-lineleader-test4_8c-example.html#a0">mindsensors-lineleader-test4.c</a>.</dd>
</dl>
<p>Definition at line <a class="el" href="common_8h_source.html#l00136">136</a> of file <a class="el" href="common_8h_source.html">common.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga1c5690729eb47d01453399497a2b3029"></a><!-- doxytag: member="common.h::tIPaddr" ref="ga1c5690729eb47d01453399497a2b3029" args="[4]" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef ubyte <a class="el" href="group__common.html#ga1c5690729eb47d01453399497a2b3029">tIPaddr</a>[4]</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Struct for holding an IP address </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="humarobotics-wifiblock-test1_8c-example.html#a3">humarobotics-wifiblock-test1.c</a>.</dd>
</dl>
<p>Definition at line <a class="el" href="common_8h_source.html#l00130">130</a> of file <a class="el" href="common_8h_source.html">common.h</a>.</p>

</div>
</div>
<a class="anchor" id="gaf1da7edf6615d1b2376642de9bbfe449"></a><!-- doxytag: member="common.h::tMassiveArray" ref="gaf1da7edf6615d1b2376642de9bbfe449" args="[128]" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef ubyte <a class="el" href="group__common.html#gaf1da7edf6615d1b2376642de9bbfe449">tMassiveArray</a>[128]</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>128 byte array for very large blobs of data </p>

<p>Definition at line <a class="el" href="common_8h_source.html#l00127">127</a> of file <a class="el" href="common_8h_source.html">common.h</a>.</p>

</div>
</div>
<a class="anchor" id="gab1288856582274ecffe7a7a3c8b2e7d9"></a><!-- doxytag: member="common.h::tsByteArray" ref="gab1288856582274ecffe7a7a3c8b2e7d9" args="[MAX_ARR_SIZE]" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef sbyte <a class="el" href="group__common.html#gab1288856582274ecffe7a7a3c8b2e7d9">tsByteArray</a>[MAX_ARR_SIZE]</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="common_8h_source.html#l00126">126</a> of file <a class="el" href="common_8h_source.html">common.h</a>.</p>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga1079ea93c9d0a5b793ea18ea2144ae7b"></a><!-- doxytag: member="common.h::clearI2Cbus" ref="ga1079ea93c9d0a5b793ea18ea2144ae7b" args="(tSensors link)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void clearI2Cbus </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>&#160;)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="gae58f52c19f82a79aedfdf5b9b3594abd"></a><!-- doxytag: member="common.h::clearI2CError" ref="gae58f52c19f82a79aedfdf5b9b3594abd" args="(tSensors link, ubyte address)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void clearI2CError </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ubyte&#160;</td>
          <td class="paramname"> <em>address</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Clear out the error state on I2C bus by sending a bunch of dummy packets. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">link</td><td>the port number </td></tr>
    <tr><td class="paramname">address</td><td>the I2C address we're sending to </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="common_8h_source.html#l00151">151</a> of file <a class="el" href="common_8h_source.html">common.h</a>.</p>

</div>
</div>
<a class="anchor" id="gaa2aa3061fe3c887f10977ce6feed3031"></a><!-- doxytag: member="common.h::getUID" ref="gaa2aa3061fe3c887f10977ce6feed3031" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">long getUID </td>
          <td>(</td>
          <td class="paramname">&#160;)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Create a unique ID (UID) for an NXT. This based on the last 3 bytes of the Bluetooth address. The first 3 bytes are manufacturer specific and identical for all NXTs and are therefore not used. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>a unique ID for the NXT. </dd></dl>

<p>Definition at line <a class="el" href="common_8h_source.html#l00396">396</a> of file <a class="el" href="common_8h_source.html">common.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga978c9ed56c6fce3d8d46f2cdca59b07e"></a><!-- doxytag: member="common.h::strtok" ref="ga978c9ed56c6fce3d8d46f2cdca59b07e" args="(char *buffer, char *token, char *seperator)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool strtok </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"> <em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"> <em>token</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"> <em>seperator</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Tokenise an array of chars, using a seperator </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">buffer</td><td>pointer to buffer we're parsing </td></tr>
    <tr><td class="paramname">token</td><td>pointer to buffer to hold the tokens as we find them </td></tr>
    <tr><td class="paramname">seperator</td><td>the seperator used between tokens </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if there are still tokens left, false if we're done </dd></dl>

<p>Definition at line <a class="el" href="common_8h_source.html#l00416">416</a> of file <a class="el" href="common_8h_source.html">common.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga4fa55ac307e9bb34f74514371f527119"></a><!-- doxytag: member="common.h::waitForI2CBus" ref="ga4fa55ac307e9bb34f74514371f527119" args="(tSensors link)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool waitForI2CBus </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>&#160;)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Wait for the I2C bus to be ready for the next message </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">link</td><td>the port number </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if no error occured, false if it did </dd></dl>

<p>Definition at line <a class="el" href="common_8h_source.html#l00174">174</a> of file <a class="el" href="common_8h_source.html">common.h</a>.</p>

</div>
</div>
<a class="anchor" id="gad02e06f83b264ee6fc7df41eb4712080"></a><!-- doxytag: member="common.h::writeI2C" ref="gad02e06f83b264ee6fc7df41eb4712080" args="(tSensors link, tByteArray &amp;request, tByteArray &amp;reply, int replylen)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool writeI2C </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a> &amp;&#160;</td>
          <td class="paramname"> <em>request</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a> &amp;&#160;</td>
          <td class="paramname"> <em>reply</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"> <em>replylen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Write to the I2C bus. This function will clear the bus and wait for it be ready before any bytes are sent. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">link</td><td>the port number </td></tr>
    <tr><td class="paramname">request</td><td>the data to be sent </td></tr>
    <tr><td class="paramname">reply</td><td>array to hold received data </td></tr>
    <tr><td class="paramname">replylen</td><td>the number of bytes (if any) expected in reply to this command </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if no error occured, false if it did </dd></dl>

<p>Definition at line <a class="el" href="common_8h_source.html#l00271">271</a> of file <a class="el" href="common_8h_source.html">common.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga98b9f725d95cc626af27f4660a8cddbe"></a><!-- doxytag: member="common.h::writeI2C" ref="ga98b9f725d95cc626af27f4660a8cddbe" args="(tSensors link, tByteArray &amp;request)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool writeI2C </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a> &amp;&#160;</td>
          <td class="paramname"> <em>request</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Write to the I2C bus. This function will clear the bus and wait for it be ready before any bytes are sent. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">link</td><td>the port number </td></tr>
    <tr><td class="paramname">request</td><td>the data to be sent </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if no error occured, false if it did </dd></dl>

<p>Definition at line <a class="el" href="common_8h_source.html#l00211">211</a> of file <a class="el" href="common_8h_source.html">common.h</a>.</p>

</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Wed Mar 13 2013 19:56:44 for ROBOTC Drivers by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.2 </small></address>
</body>
</html>
